#TIL
https://github.com/golang/go/issues/73707
slog.Logger is designed to be a logging frontend. if you need an alternative frontend, like in some bridge, we expect you to call slog.Handler directly.
https://github.com/golang/go/issues/73707
GitHub
proposal: log/slog: Add LogDepth · Issue #73707 · golang/go
Proposal Details When implementing bridging logger types with slog as backend, the pc used for getting source info is incorrect. The current workaround would be copying Logger.log, and tweaking the...
#TIL
原来这种风格的结构化日志格式叫 logfmt。
https://brandur.org/logfmt
level=DEBUG msg="received seed" component=preprocessor.worker worker_id=2 seed=f0523
原来这种风格的结构化日志格式叫 logfmt。
https://brandur.org/logfmt
brandur.org
logfmt
A logging format used inside companies such as Heroku and Stripe which is optimal for easy development, consistency, and good legibility for humans and computers.
❤1
#TIL
才知道 corner case 与 edge case 不是同义词。
> Where an edge case involves pushing one variable to a minimum or maximum, putting users at the "edge" of the configuration space, a corner case involves doing so with multiple variables, which would put users at a "corner" of a multidimensional configuration space...
https://en.wikipedia.org/wiki/Corner_case
才知道 corner case 与 edge case 不是同义词。
> Where an edge case involves pushing one variable to a minimum or maximum, putting users at the "edge" of the configuration space, a corner case involves doing so with multiple variables, which would put users at a "corner" of a multidimensional configuration space...
https://en.wikipedia.org/wiki/Corner_case
Wikipedia
Corner case
problem or situation that occurs only outside normal operating parameters, when multiple environmental variables or conditions are simultaneously at extreme levels
❤4